#!/bin/sh
pasta=$1
N=$2
CPS=$3

arquivo_c=$pasta/times$N.txt

echo "checkpoint on" $(date +%s)
echo $(date +%s) >> $arquivo_c


i=0
while [ $i -ne $CPS ]
do

  read X
  echo "checkpoint on" $(date +%s)
  echo $(date +%s) >> $arquivo_c
  
  i=`expr $i + 1`

done 

echo fim > $pasta/temp

sleep 1
